﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/Management.master" AutoEventWireup="true"
    CodeFile="Category.aspx.cs" Inherits="Admin_Category" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
        <tr>
            <td style="vertical-align: top;">
                管理单元列表：<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataTextField="Name"
                    DataValueField="ID" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:GridView ID="gv_Category" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    ForeColor="Red" GridLines="None" EmptyDataText="暂无数据">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:TemplateField HeaderText="管理项目" SortExpression="Name">
                            <ItemTemplate>
                                <span style="color: Black;">名称：</span><span style="font-weight: bold;"><%# Eval("Name") %></span>
                                <br />
                                <span style="color: Black;">URL：</span><%# Eval("URL") %>
                                <br />
                                <span style="color: Black;">说明：</span><%# string.IsNullOrEmpty(Eval("Description").ToString()) ? "暂无" : Eval("Description")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField SortExpression="Name">
                            <ItemTemplate>
                                <%# Convert.ToBoolean(Eval("Open").ToString())==false?"已锁":string.Empty %></div>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="排序" SortExpression="Name">
                            <ItemTemplate>
                                <div style="width: 50px; padding-left: 5px;">
                                    <span style="color: Black;">
                                        <%# Eval("Order") %></span></div>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:Button ID="btn_Update" runat="server" CommandArgument='<%# Eval("ID") %>' OnClick="btn_Update_Click"
                                    Text="编辑" />
                                <asp:Button ID="btn_Delete" runat="server" CommandArgument='<%# Eval("ID") %>' OnClick="btn_Delete_Click"
                                    Text="删除" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </td>
            <td style="vertical-align: top;">
                <asp:Button ID="btn_Add" runat="server" Text="添加" CssClass="Button" OnClick="btn_Add_Click" /><div
                    class="Dialog" id="panel_Add" runat="server">
                    <div class="Title">
                        添加</div>
                    <div class="Content">
                        <span style="color: Red;">*</span>名称：<asp:TextBox ID="txt_NameAdd" runat="server"
                            MaxLength="10"></asp:TextBox>
                        <br />
                        <span style="color: Red;">*</span>URL：<asp:TextBox ID="txt_Url" MaxLength="50" runat="server"
                            Width="200px"></asp:TextBox>
                        <br />
                        备注：<asp:TextBox ID="txt_Description" MaxLength="50" runat="server" Rows="4" TextMode="MultiLine"></asp:TextBox>
                        <br />
                        <asp:Button ID="btn_AddSubmit" runat="server" Text="添加" OnClick="btn_AddSubmit_Click"
                            Width="100px" />
                        &nbsp;<asp:Button ID="btn_UpdateCancel0" runat="server" OnClick="btn_UpdateCancel_Click"
                            Text="取消" CssClass="Button" />
                    </div>
                </div>
                <div class="Dialog" id="panel_Edit" runat="server">
                    <div class="Title">
                        编辑</div>
                    <div class="Content">
                        <span style="color: Red;">*</span>名称：<asp:TextBox ID="txt_NameUpdate" runat="server"
                            MaxLength="10"></asp:TextBox>
                        <br />
                        <span style="color: Red;">*</span>URL：<asp:TextBox ID="txt_UrlUpdate" runat="server"
                            Width="200px"></asp:TextBox>
                        <br />
                        排序:<asp:TextBox ID="txt_Order" runat="server"></asp:TextBox>
                        <br />
                        锁定:<asp:RadioButtonList ID="rb_Lock" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="False">锁定</asp:ListItem>
                            <asp:ListItem Value="True">开放</asp:ListItem>
                        </asp:RadioButtonList>
                        <br />
                        说明：<asp:TextBox ID="txt_DescriptionUpdate" runat="server" Rows="4" TextMode="MultiLine"></asp:TextBox>
                        &nbsp;<br />
                        <asp:Button ID="btn_UpdateSubmit" runat="server" OnClick="btn_UpdateSubmit_Click"
                            Text="更新" CssClass="Button" />
                        &nbsp;<asp:Button ID="btn_UpdateCancel" runat="server" OnClick="btn_UpdateCancel_Click"
                            Text="取消" CssClass="Button" />
                    </div>
                </div>
                <asp:Label ID="lbl_Error" runat="server" EnableViewState="False" ForeColor="Red"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
